import Vue from 'vue'
import Router from 'vue-router'

const index = (resolve) => {
  import('@/components/index/index.vue').then((module) => {
    resolve(module)
  })
}

const tpD = (resolve) => {
  import('@/components/topicDetail/topicDetail.vue').then((module) => {
    resolve(module)
  })
}

Vue.use(Router)
export default new Router({
  mode: 'history',
  routes: [
    { path: '/', redirect: '/index' },
    {
      path: '/index',
      name: 'index',
      component: index,
      children:[
        {
          path: 'tpD',
          name: 'tpD',
          component: tpD
        }
      ]
    },
    // {
    //   path: '/tpD',
    //   name: 'tpD',
    //   component: tpD
    // }
  ]
})
